import Vapor

/// Called before your application initializes.
public func configure(_ config: inout Config, _ env: inout Environment, _ services: inout Services) throws {
    // Register routes to the router
    let router = EngineRouter.default()
    try routes(router)
    services.register(router, as: Router.self)
    
    var nioServerConfig = NIOServerConfig.default()
    nioServerConfig.maxBodySize = 200 * 1024 * 1024
    services.register(nioServerConfig)

    // Register middleware
    try MiddlewaresConfigure(&config, &env, &services)
    // Configure a MySQL database
    try DatabaseConfigure(&config, &env, &services)
    // Configure migrations
    try MigrationConfigure(&config, &env, &services)
}
